<?php

$cars = array("BMW","Lamborghini","Maserati");
echo $cars[1];
$cars[2] = "Audi";


echo "<pre>";
print_r($cars);
echo count($cars);

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

echo "</hr>";
echo "foreach ::::.<br/>";
foreach ($cars as $value) {
    echo $value ."<br/>";
}

echo "</hr>";
echo "for.<br/>";
$len = count($cars);
for ($i = 0; $i < $len; $i++) {
    echo $cars[$i]."<br/>";
}

?>